﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ClassType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {   //object类型---->Object类
        object obj = new object();
        Response.Write(obj+"<br>");
        Response.Write(obj.Equals(sender) + "<br>");
        Response.Write(obj.GetHashCode() + "<br>");
        Response.Write(obj.GetType() + "<br>");
        Response.Write(obj.ToString() + "<br>");

        //string类型----->String类
        string str1 = "abc 124 def 345 ghi";
        string[] strArray;
        strArray = str1.Split(' ');
        foreach(var str in strArray)
        {
            Response.Write(str + "<br>");
        }
        Response.Write("ABC".ToLower()+"<br>");
        Response.Write("中华人民共和国".Length + "<br>");

        Book book = new Book();
        book.bookName = "平凡的世界";
        book.page = 360;
        book.price = 34.0;
        Response.Write(String.Format("{0}共{1}页{2}元<br>", book.bookName, book.page, book.price));

        Book b2 = book;//指向同一内存区域
        b2.price = 100;
        Response.Write(String.Format("{0}共{1}页{2}元<br>", book.bookName, book.page, book.price));
    }
}

class Book
{
    public string bookName;
    public int page;
    public double price;
}